<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Simple Examples</title>
		<script type="text/javascript" src="js/jquery.js"></script>
	</head>
	<body>
		<h3>默认模式</h3>
		<form>
			<textarea id="a" name="content" style="width:700px;height:300px;">
				&lt;strong&gt;HTML内容&lt;/strong&gt;
			</textarea>
		</form>
		
		<script type="text/javascript" charset="utf-8" src="editor/kindeditor.js"></script>
		<script type="text/javascript"> 
			var id="a";
			KindEditor.ready(function(K) {
				K.create("#"+id,
							{
								items : [ 'fontname', 'fontsize', '|',
										'forecolor', 'hilitecolor', 'bold',
										'italic', 'removeformat', '|',
										'emoticons', ],
							afterChange : function() {
								K('.word_count1').html(this.count());
	
								K('.word_count2').html(
								this.count('text'));
											
							if (this.count('text') > 140) {
								alert("最多只能输入140个字符");
								var a = $("#"+id).val();
								a = $("#"+id).val().substring(0, 140);
								return false;
							}
						}
					});
				});
		</script>
	</body>
</html>
